﻿namespace MiddlewareDemo.Host.Middlewares
{
    public class SecondMiddleware : IMiddleware, IDisposable
    {
        public async Task InvokeAsync(HttpContext context, RequestDelegate next)
        {
            await context.Response.WriteAsync($"{nameof(SecondMiddleware)} Before\n");
            await next(context);
            await context.Response.WriteAsync($"{nameof(SecondMiddleware)} After\n");
        }

        public void Dispose()
        {
            
        }
    }
}
